<script setup>
import { onMounted } from 'vue'
import { useUserStore } from './store/user'

// 获取用户状态
const userStore = useUserStore()

// 页面加载时初始化用户状态
onMounted(() => {
  userStore.initUserState()
})
</script>

<template>
  <div id="app">
    <router-view />
  </div>
</template>

<style>
/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
}

#app {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 响应式布局 */
@media screen and (max-width: 768px) {
  .el-form-item {
    margin-bottom: 18px;
  }
  
  .el-card__header {
    padding: 15px;
  }
  
  .el-card__body {
    padding: 15px;
  }
  
  .el-table .cell {
    padding-left: 5px;
    padding-right: 5px;
  }
}

@media screen and (max-width: 576px) {
  .el-dialog {
    width: 90% !important;
    margin: 10px auto !important;
  }
  
  .el-form-item__label {
    float: none;
    display: block;
    padding: 0 0 8px;
    line-height: 1.5;
    text-align: left;
  }
  
  .el-form-item__content {
    margin-left: 0 !important;
  }
  
  .el-button {
    padding: 8px 15px;
  }
}
</style>
